#include "worker.h"
#include <QDebug>
#include <QThread>

Worker::Worker(QTcpSocket* client, QObject *parent)
    : QObject(parent)
    , m_client(client)
{
}

Worker::~Worker()
{

}

void Worker::doWork()
{
    qDebug() << "Work Thread id: " << QThread::currentThread();
    QString result;
    if (m_client != NULL){
        qDebug() << "Thread: " << this->thread();
        QByteArray msg =  m_client->readAll();
        result = QString(msg).toUpper();
        msg = result.toUtf8();
        m_client->write(msg);
    }
}

